<template>
	<view class="main_box">
		<view class="fix_title">
			6/8开户成功
		</view>
		<view class="txt">
			您的账户已开通
		</view>
		<view class="card">
			<view class="pos_top">
				<view class="title">
					<view class="img">
						<image src="/static/images/blank/4341.png" mode=""></image>
					</view>
					<view class="text">
						校园电子钱包
					</view>
				</view>
				<view class="user">
					账号
				</view>
				<view class="number">
					{{userInfo.number}}
				</view>
				<template v-if="userInfo.accountType!=2">
					<view class="tips">
						可用余额(元)
					</view>
					<view class="sum">
						{{userInfo.price}}
					</view>
				</template>
			</view>
			<image src="/static/images/blank/bacg.png" mode=""></image>
		</view>
		<view class="btn" @click="toNext">
			下一步
		</view>
		<view class="kdn">
			<image src="/static/images/blank/4341yu.png" mode=""></image>
			<view class="subx">
				交通银行 提供产品服务
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getPhoneCode,
		getTwoUserList,
		putIdentity,
		personFace,
		getMoneny
	} from '../../common/api/blank.js';
	import {
		_showLoading,
		_showToast
	} from '../../common/js/util.js'
	export default {
		data() {
			return {
				userInfo: {
					name: "",
					price: "",
					number: ''
				},
				orgId: "",
				batId: ""
			}
		},
		onBackPress(options) {
			if (options.from === 'navigateBack') {
				return false
			}
			this.back();
			return true
		},
		async onLoad(option) {
			this.orgId = option.orgId
			this.batId = option.batId
			uni.showLoading({
				title: "获取信息中"
			})
			try {
				const res = await getMoneny({
					batId: this.batId,
					orgId: this.orgId
				})
				console.log(res)
				if (res.code == 0) {
					uni.hideLoading()
					this.batId = res.data.batId
					this.orgId = res.data.orgId
					this.userInfo.name = res.data.idName
					this.userInfo.price = res.data.freezeAmount
					this.userInfo.number = res.data.cardNo
					this.userInfo.accountType=res.data.accountType
				} else {
					uni.hideLoading()
					_showToast(res.msg)
				}
			} catch (err) {
				uni.hideLoading()
				_showToast(err)
			}

		},
		components: {

		},
		methods: {
			back() {
				var pages = getCurrentPages();
				uni.navigateBack({
					delta: pages.length - 1
				})
			},
			//下一步
			toNext() {
				uni.navigateTo({
					url: `/pageBlank/quickPayment/quickPayment?batId=${this.batId}&orgId=${this.orgId}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main_box {
		padding: 24upx;
		box-sizing: border-box;
		overflow-y: auto;

		.kdn {
			margin: 86rpx 0rpx;
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;

			>image {
				width: 34rpx;
				height: 33rpx;
			}

			.subx {
				margin-left: 8rpx;
				height: 34rpx;
				font-size: 24rpx;
				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
				font-weight: 400;
				color: #003A79;
				line-height: 34rpx;
			}
		}

		.card {
			width: 676rpx;
			height: 374rpx;
			margin: 0 auto;
			position: relative;
			box-sizing: border-box;
			padding-left: 30rpx;
			padding-top: 25rpx;
			margin-bottom: 320rpx;

			>image {
				width: 100%;
				height: 100%;
				position: absolute;
				top: 0rpx;
				left: 0rpx;
				z-index: 4;
			}

			.pos_top {
				position: absolute;
				z-index: 5;

				.user {
					height: 32rpx;
					font-size: 26rpx;
					font-family: Source Han Sans CN-Light, Source Han Sans CN;
					font-weight: 300;
					color: #FFFFFF;
					line-height: 32rpx;
					margin-bottom: 6rpx;

				}

				.number {
					height: 40rpx;
					font-size: 36rpx;
					font-family: Source Han Sans CN-Light, Source Han Sans CN;
					font-weight: 300;
					color: #FFFFFF;
					line-height: 40rpx;
					margin-bottom: 21rpx;
				}

				.sum {
					height: 66rpx;
					font-size: 48rpx;
					font-family: Source Han Sans CN-Bold, Source Han Sans CN;
					font-weight: bold;
					color: #FFFFFF;
					line-height: 66rpx;
				}

				.tips {
					height: 32rpx;
					font-size: 26rpx;
					font-family: Source Han Sans CN-Light, Source Han Sans CN;
					font-weight: 300;
					color: #FFFFFF;
					line-height: 32rpx;
					margin-bottom: 6rpx;
				}

				.title {
					height: 34rpx;
					display: flex;
					align-items: center;
					margin-bottom: 23rpx;

					.img {
						image {
							width: 34rpx;
							height: 34rpx;

						}
					}

					.text {
						margin-left: 8rpx;
						height: 34rpx;
						font-size: 26rpx;
						font-family: Source Han Sans CN-Light, Source Han Sans CN;
						font-weight: 300;
						color: #FFFFFF;
						line-height: 34rpx;
					}

				}
			}
		}

		.btn {
			width: 358rpx;
			height: 88rpx;
			line-height: 88rpx;
			text-align: center;
			background: #3478F5;
			box-shadow: 0rpx 3rpx 26rpx 1rpx rgba(55, 98, 244, 0.58);
			border-radius: 44rpx 44rpx 44rpx 44rpx;
			opacity: 1;
			font-size: 32rpx;
			font-family: Source Han Sans CN-Light, Source Han Sans CN;
			font-weight: 300;
			color: #FFFFFF;
			margin: 0 auto;
		}

		.fix_title {
			margin: 30upx 0 60upx 0;
			font-size: 40upx;
			font-weight: bolder;
			display: flex;
			align-items: center;
			margin-left: 10rpx;

			&::before {
				content: '';
				height: 36upx;
				width: 12upx;
				background-image: linear-gradient(to bottom, #c3defc, #007AFF);
				margin-right: 12upx;
				border-radius: 6upx;
			}
		}

		.txt {
			height: 46rpx;
			font-size: 32rpx;
			font-family: Source Han Sans CN-Medium, Source Han Sans CN;
			font-weight: 500;
			color: #020202;
			line-height: 46rpx;
			margin-bottom: 68rpx;
			margin-left: 32rpx;
			margin-top: 56rpx;

		}
	}
</style>
